x86: fix early boot command line parsing
authorDaniel Kiper <daniel.kiper@oracle.com>
Wed, 4 Dec 2013 12:26:37 +0000 (13:26 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Dec 2013 12:26:37 +0000 (13:26 +0100)
There is no reliable way to encode NUL character as a character so encode
it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
Octal and hex encoding do not work on at least one system (GNU assembler
version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
Without this fix e.g. no-real-mode option at the end of xen.gz command line
is not detected.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/boot/cmdline.S

index 05ffb941e5831f5a7f0066038f18c8764d865ead..e1f45951a9e212b794d28aef1715b0e3381d093d 100644 (file)
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f